﻿<UserControl x:Class="WhiteFlow.DevTrackingTool.UI.Views.StatsView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:converters="clr-namespace:WhiteFlow.DevTrackingTool.UI.Converters"
             xmlns:charting="clr-namespace:System.Windows.Controls.DataVisualization.Charting;assembly=System.Windows.Controls.DataVisualization.Toolkit"
             mc:Ignorable="d" 
             d:DesignHeight="371" 
             d:DesignWidth="743">

    <UserControl.Resources>
        <converters:DateTimeConverter x:Key="DateTimeConverter" />
    </UserControl.Resources>
    
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="auto" />
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>

        <TextBlock Text="Stats Charts" 
                   Grid.Row="0"
                   Margin="20,0,0,0" 
                   FontSize="50" 
                   Foreground="{StaticResource ResourceKey=BlueFgBrush}" 
                   FontFamily="/WhiteFlow.DevTrackingTool.UI;Component/Resources/Fonts/#BIRTH OF A HERO" />

        <Grid Grid.Row="1">
            <charting:Chart Name="WsChart" 
                            Foreground="Black"
                            BorderBrush="Transparent">
                <charting:LineSeries Title="{Binding Path=ChartTitle}"
                                     IndependentValueBinding="{Binding Path=CalendarDay, Converter={StaticResource ResourceKey=DateTimeConverter}}"
                                     DependentValueBinding="{Binding Path=Summary.AllTasksTotalTimeDecimal}"
                                     ItemsSource="{Binding Path=OwnerWorksheetViewModel.Worksheet.Days}"
                                     IsSelectionEnabled="True">
                    <charting:LineSeries.DataPointStyle>
                        <Style TargetType="{x:Type Control}">
                            <Setter Property="Control.Cursor" Value="Hand" />
                        </Style>
                    </charting:LineSeries.DataPointStyle>
                </charting:LineSeries>
            </charting:Chart>
        </Grid>
    </Grid>
    
</UserControl>